#include "bsp_showWorld.h"
#include "que.h"
#include <stdio.h>
#include "string.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "driver/gpio.h"
#include "esp_log.h"
#include "driver/uart.h"
#include "bsp_uart.h"
#include "string.h"
esp_tx_t esp_tx[8];
uint8_t send_count = 0 ;
char prudent[20][20] = {0};
TaskHandle_t  show_sd_handle;

void show_task(void){
    const char* need_sd_wold[20] = {""};
    bool get_wold_flag = false ;
    uint8_t get_wold_page = 0;
    uint8_t show_index = 0 ;//第几个单词
    uint8_t wold_page = 0;
    bool show_insert_in = false ;
    BrailleCode_t BrailleCode[20][20];
    
    need_sd_wold[0] = "today";
    need_sd_wold[1] = "have";
    need_sd_wold[2] = "apple";
    need_sd_wold[3] = "grape";
    need_sd_wold[4] = "kiwi";
    need_sd_wold[5] = "lemon";
    need_sd_wold[6] = "mango";
    need_sd_wold[7] = "pear";
    need_sd_wold[8] = "peach";
    need_sd_wold[9] = "plum";
    need_sd_wold[10] = "straw";
    need_sd_wold[11] = "water";
    need_sd_wold[12] = "melon";
    need_sd_wold[13] = "berry";
    need_sd_wold[14] = "mango";
    need_sd_wold[15] = "grape";
    need_sd_wold[16] = "kiwi";
    need_sd_wold[17] = "apple";
    need_sd_wold[18] = "pear";
    need_sd_wold[19] = "lemon";

    for(;;){
        if(show_insert_in == false) {
            EventBits_t ev=xEventGroupWaitBits(button_event_group,BUTTOM_1|BUTTOM_2,pdTRUE,pdTRUE,0);
            if((ev&BUTTOM_1)&&(ev&BUTTOM_2)&&show_insert_in == false) {
                show_insert_in = true;
                //vTaskResume(show_sd_handle);
            }
        }

        if(show_insert_in){

            //ttf:,启动任务)发送队列vocabulary_index_queue 发送int index 播放音频，发送-1就是重复当前音频 
            //jq:完成need_sd_wold数组初始化，     bool read_sd_page(char * need_sd_wold[20]){}
            //周五整合代码
            ESP_LOGI("bsp_showWorld.c","show wold ing-----------------------------------");
            if(get_wold_page == 0){//第一次读取
                //bool read_sd_page(char * need_sd_wold[20],uint8_t sd_page){}
                // get_wold_flag = read_sd_page(need_sd_wold,get_wold_page);
                for(uint8_t wold_index = 0; wold_index<TOTAL_WOLD;wold_index++){

                }
                get_wold_page = 1;
            } 
            if( get_wold_flag == 0){
                
                uint8_t len_of_wold[20] = {0};//第几个单词的长度
                for(uint8_t i = 0; i<20;i++){
                    int len_of_wold_ttf = strlen(need_sd_wold[i]);
                    for(uint8_t j = 0; j<len_of_wold_ttf;j++){
                        prudent[i][j] = need_sd_wold[i][j];
                    }
                    len_of_wold[i] = len_of_wold_ttf;
                    //ESP_LOGI("bsp_showWorld.c","[%s] len is: %d",need_sd_wold[i],len_of_wold[i]);
                }
/*
                一下为判断按键
*/
                EventBits_t ev;
                ev=xEventGroupWaitBits(button_event_group,BUTTOM_0|BUTTOM_1|BUTTOM_2,pdFALSE,pdFALSE,200);
                if((ev&BUTTOM_1)&&(ev&BUTTOM_2)&&show_insert_in == true){
                    show_insert_in = false;
                    ESP_LOGI("bsp_showWorld.c","exist the showing mode");
                    xEventGroupClearBits(button_event_group,BUTTOM_0|BUTTOM_1);
                }
                else if(ev&BUTTOM_0) {//重复当前单词
                    show_index = show_index ;
                    int send_to_jq_task = -1;
                    //xQueueSend(vocabulary_index_queue,send_to_jq_task,0);
                    ESP_LOGW("bsp_showWorld.c","reread the present wold");
                    xEventGroupClearBits(button_event_group,BUTTOM_0);
                }
                else if (ev&BUTTOM_1){//单词下一个
                    if(show_index<=19&&show_index>=0) show_index +=1;
                    ESP_LOGE("bsp_showWorld.c","pin_turn_state is %d",pin_turn_state);
                    pin_turn_state = NEXT_WOLD_p;
                    xEventGroupClearBits(button_event_group,BUTTOM_1);
                    if(show_index == 19){
                        get_wold_page++;
                        //read_sd_page(char * need_sd_wold[20],uint8_t sd_page){}
                        //get_wold_flag = read_sd_page(need_sd_wold,get_wold_page);
                        show_index = 0 ;
                    }
                    //xQueueSend(vocabulary_index_queue,show_index,0);
                    vTaskDelay(200);
                }
                else if (ev&BUTTOM_2){//单词上一个
                    if(show_index<=20&&show_index>=1) show_index-=1;
                    else ESP_LOGE("bsp_showWorld.c","it is the first wold!!");
                    ESP_LOGE("bsp_showWorld.c","pin_turn_state is %d",pin_turn_state);
                    pin_turn_state = AHEAD_WOLD_p;
                    xEventGroupClearBits(button_event_group,BUTTOM_2);
                    //xQueueSend(vocabulary_index_queue,show_index,0);
                    vTaskDelay(200);
                }
                // // else if (ev&BUTTOM_3){//单词翻页
                // //     if(len_of_wold[show_index]>6) wold_page +=1;
                // //     ESP_LOGE("bsp_showWorld.c","pin_turn_state is--------------------------- 'TURN_PAGE_p'");
                // //     pin_turn_state = TURN_PAGE_p;
                // //     xEventGroupClearBits(button_event_group,BUTTOM_3);
                // //     vTaskDelay(200);
                // // }
                // // else if (ev&BUTTOM_4){//单词上一页
                // //     if(len_of_wold[show_index]>6&&wold_page>=1) wold_page -=1;
                // //     ESP_LOGE("bsp_showWorld.c","pin_turn_state is--------------------------- 'AHEAD_PAGE_p'");
                // //     pin_turn_state = AHEAD_PAGE_p;
                // //     xEventGroupClearBits(button_event_group,BUTTOM_4);
                // //     vTaskDelay(200);
                // // }
                // // else if (ev&BUTTOM_5){//重复读一次单词
                // //     int send_to_jq_task = -1;
                // //     xQueueSend(vocabulary_index_queue,send_to_jq_task);
                // //     xEventGroupClearBits(button_event_group,BUTTOM_5);
                // //     vTaskDelay(200);
                // // }

                memset(BrailleCode,0,sizeof(BrailleCode));

                for(uint8_t i = 0; i < len_of_wold[show_index];i++){
                    char gogo_char = prudent[show_index][i];//遍历的字母
                    for(uint8_t j = 0 ; j < 26 ; j ++){
                        if(gogo_char == 'a') BrailleCode[show_index][i] = A_CHAR;
                        else if(gogo_char == 'b') BrailleCode[show_index][i] = B_CHAR;
                        else if(gogo_char == 'c') BrailleCode[show_index][i] = C_CHAR;
                        else if(gogo_char == 'd') BrailleCode[show_index][i] = D_CHAR;
                        else if(gogo_char == 'e') BrailleCode[show_index][i] = E_CHAR;
                        else if(gogo_char == 'f') BrailleCode[show_index][i] = F_CHAR;
                        else if(gogo_char == 'g') BrailleCode[show_index][i] = G_CHAR;
                        else if(gogo_char == 'h') BrailleCode[show_index][i] = H_CHAR;
                        else if(gogo_char == 'i') BrailleCode[show_index][i] = I_CHAR;
                        else if(gogo_char == 'j') BrailleCode[show_index][i] = J_CHAR;
                        else if(gogo_char == 'k') BrailleCode[show_index][i] = K_CHAR;
                        else if(gogo_char == 'l') BrailleCode[show_index][i] = L_CHAR;
                        else if(gogo_char == 'm') BrailleCode[show_index][i] = M_CHAR;
                        else if(gogo_char == 'n') BrailleCode[show_index][i] = N_CHAR;
                        else if(gogo_char == 'o') BrailleCode[show_index][i] = O_CHAR;
                        else if(gogo_char == 'p') BrailleCode[show_index][i] = P_CHAR;
                        else if(gogo_char == 'q') BrailleCode[show_index][i] = Q_CHAR;
                        else if(gogo_char == 'r') BrailleCode[show_index][i] = R_CHAR;
                        else if(gogo_char == 's') BrailleCode[show_index][i] = S_CHAR;
                        else if(gogo_char == 't') BrailleCode[show_index][i] = T_CHAR;
                        else if(gogo_char == 'u') BrailleCode[show_index][i] = U_CHAR;
                        else if(gogo_char == 'v') BrailleCode[show_index][i] = V_CHAR;
                        else if(gogo_char == 'w') BrailleCode[show_index][i] = W_CHAR;
                        else if(gogo_char == 'x') BrailleCode[show_index][i] = X_CHAR;
                        else if(gogo_char == 'y') BrailleCode[show_index][i] = Y_CHAR;
                        else if(gogo_char == 'z') BrailleCode[show_index][i] = Z_CHAR;
                        else BrailleCode[show_index][i] = BRAILLE_INVALID;
                    }
                }
                show_index_wold_page(show_index,wold_page,&len_of_wold,BrailleCode);
            }
        }
    vTaskDelay(1000);
    }  
}

void show_index_wold_page(uint8_t show_index,uint8_t wold_page,uint8_t* len_of_wold,BrailleCode_t BrailleCode_tt[20][20]){
    ESP_LOGE("bsp_showWorld.h", " index is %d,wold page is %d",show_index,wold_page);
    memset(&esp_tx,0,sizeof(esp_tx_t)*8);

    esp_tx[0].head = HT_HEAD;
    esp_tx[0].tail = HT_TAIL;
    esp_tx[0]._2_head = HT_HEAD;
    esp_tx[0]._2_tail = HT_TAIL;
    esp_tx[0].HT_CH = 0;
    esp_tx[0]._2_HT_CH = 0 ;
    esp_tx[0].CELL_CH = 0 ;
    esp_tx[0]._2_CELL_CH = 1 ;

    esp_tx[1].head = HT_HEAD;
    esp_tx[1].tail = HT_TAIL;
    esp_tx[1]._2_head = HT_HEAD;
    esp_tx[1]._2_tail = HT_TAIL;
    esp_tx[1].HT_CH = 1;
    esp_tx[1]._2_HT_CH = 1 ;
    esp_tx[1].CELL_CH = 0 ;
    esp_tx[1]._2_CELL_CH = 1 ;

    esp_tx[2].head = HT_HEAD;
    esp_tx[2].tail = HT_TAIL;
    esp_tx[2]._2_head = HT_HEAD;
    esp_tx[2]._2_tail = HT_TAIL;
    esp_tx[2].HT_CH = 2;
    esp_tx[2]._2_HT_CH = 2 ;
    esp_tx[2].CELL_CH = 0 ;
    esp_tx[2]._2_CELL_CH = 1 ;

    esp_tx[3].head = HT_HEAD;
    esp_tx[3].tail = HT_TAIL;
    esp_tx[3]._2_head = HT_HEAD;
    esp_tx[3]._2_tail = HT_TAIL;
    esp_tx[3].HT_CH = 0;
    esp_tx[3]._2_HT_CH = 0 ;
    esp_tx[3].CELL_CH = 0 ;
    esp_tx[3]._2_CELL_CH = 1 ;

    esp_tx[4].head = HT_HEAD;
    esp_tx[4].tail = HT_TAIL;
    esp_tx[4]._2_head = HT_HEAD;
    esp_tx[4]._2_tail = HT_TAIL;
    esp_tx[4].HT_CH = 1;
    esp_tx[4]._2_HT_CH = 1 ;
    esp_tx[4].CELL_CH = 0 ;
    esp_tx[4]._2_CELL_CH = 1 ;

    esp_tx[5].head = HT_HEAD;
    esp_tx[5].tail = HT_TAIL;
    esp_tx[5]._2_head = HT_HEAD;
    esp_tx[5]._2_tail = HT_TAIL;
    esp_tx[5].HT_CH = 2;
    esp_tx[5]._2_HT_CH = 2 ;
    esp_tx[5].CELL_CH = 0 ;
    esp_tx[5]._2_CELL_CH = 1 ;

    for(uint8_t i = 0 ; i < len_of_wold[show_index]; i+=2){
        esp_tx[i/2].CELL_0 = (BrailleCode_tt[show_index][i] >> 5) & 1;
        esp_tx[i/2].CELL_1 = (BrailleCode_tt[show_index][i] >> 4) & 1;
        esp_tx[i/2].CELL_2 = (BrailleCode_tt[show_index][i] >> 3) & 1;
        esp_tx[i/2].CELL_3 = (BrailleCode_tt[show_index][i] >> 2) & 1;
        esp_tx[i/2].CELL_4 = (BrailleCode_tt[show_index][i] >> 1) & 1;
        esp_tx[i/2].CELL_5 = (BrailleCode_tt[show_index][i] >> 0) & 1;
        esp_tx[i/2].HT_CH = i/2 ;
        esp_tx[i/2].CELL_CH = 0;

        if((len_of_wold[show_index]%2 == 1 )&& ((i+1)==len_of_wold[show_index])){
            esp_tx[i/2]._2_pin_0 = BrailleCode_tt[show_index][i+1] & 0;
            esp_tx[i/2]._2_pin_1 = BrailleCode_tt[show_index][i+1] & 0;
            esp_tx[i/2]._2_pin_2 = BrailleCode_tt[show_index][i+1] & 0;
            esp_tx[i/2]._2_pin_3 = BrailleCode_tt[show_index][i+1] & 0;
            esp_tx[i/2]._2_pin_4 = BrailleCode_tt[show_index][i+1] & 0;
            esp_tx[i/2]._2_pin_5 = BrailleCode_tt[show_index][i+1] & 0;
            esp_tx[i/2]._2_HT_CH = i/2;
            esp_tx[i/2]._2_CELL_CH = 1;
            
            ESP_LOGW("bsp_showWorld.h", "this is the last letter 1");
        }
        else{
            esp_tx[i/2]._2_pin_0 = (BrailleCode_tt[show_index][i+1] >> 5) & 1;
            esp_tx[i/2]._2_pin_1 = (BrailleCode_tt[show_index][i+1] >> 4) & 1;
            esp_tx[i/2]._2_pin_2 = (BrailleCode_tt[show_index][i+1] >> 3) & 1;
            esp_tx[i/2]._2_pin_3 = (BrailleCode_tt[show_index][i+1] >> 2) & 1;
            esp_tx[i/2]._2_pin_4 = (BrailleCode_tt[show_index][i+1] >> 1) & 1;
            esp_tx[i/2]._2_pin_5 = (BrailleCode_tt[show_index][i+1] >> 0) & 1;
            ESP_LOGW("BrailleCode_tt[show_index][i+1] >> 0) & 1","is %d",esp_tx[i/2]._2_pin_5);
            esp_tx[i/2]._2_HT_CH = i/2;
            esp_tx[i/2]._2_CELL_CH = 1;
            //ESP_LOGW("bsp_showWorld.h", "single-2 index is %d",show_index);
        }

    }
    switch (wold_page){
        case 0:
        uart_write_bytes(UART_NUM_2,&esp_tx[0],sizeof(esp_tx_t));
        vTaskDelay(100);
        //ESP_ERROR_CHECK(uart_wait_tx_done(UART_NUM_2, 100));
        uart_write_bytes(UART_NUM_2,&esp_tx[1],sizeof(esp_tx_t));
        vTaskDelay(100);
        //ESP_ERROR_CHECK(uart_wait_tx_done(UART_NUM_2, 100));
        uart_write_bytes(UART_NUM_2,&esp_tx[2],sizeof(esp_tx_t));
        //ESP_ERROR_CHECK(uart_wait_tx_done(UART_NUM_2, 100));
        vTaskDelay(100);
        ESP_LOGW("bsp_showWorld.h", "show wold [%s] ing in uart",prudent[show_index]);
        ESP_LOGW("bsp_showWorld.h", "wold page is in 0 ing--------------");
        ESP_LOGW("bsp_showWorld.h", "BrailleCode[show_index][0] is %d", BrailleCode_tt[show_index][0]);
        ESP_LOGW("bsp_showWorld.h", "BrailleCode[show_index][1] is %d", BrailleCode_tt[show_index][1]);
        ESP_LOGW("bsp_showWorld.h", "BrailleCode[show_index][2] is %d", BrailleCode_tt[show_index][2]);
        ESP_LOGW("bsp_showWorld.h", "BrailleCode[show_index][3] is %d", BrailleCode_tt[show_index][3]);
        ESP_LOGW("bsp_showWorld.h", "BrailleCode[show_index][4] is %d", BrailleCode_tt[show_index][4]);
        ESP_LOGW("bsp_showWorld.h", "BrailleCode[show_index][5] is %d", BrailleCode_tt[show_index][5]);
        ESP_LOGE("bsp_showWorld.h","%d %d %d %d %d %d   %d %d %d %d %d %d",
            esp_tx[0].CELL_0,esp_tx[0].CELL_1,esp_tx[0].CELL_2,esp_tx[0].CELL_3,esp_tx[0].CELL_4,esp_tx[0].CELL_5,
            esp_tx[0]._2_pin_0,esp_tx[0]._2_pin_1,esp_tx[0]._2_pin_2,esp_tx[0]._2_pin_3,esp_tx[0]._2_pin_4,esp_tx[0]._2_pin_5);
        ESP_LOGE("bsp_showWorld.h","%d %d %d %d %d %d   %d %d %d %d %d %d",
            esp_tx[1].CELL_0,esp_tx[1].CELL_1,esp_tx[1].CELL_2,esp_tx[1].CELL_3,esp_tx[1].CELL_4,esp_tx[1].CELL_5,
            esp_tx[1]._2_pin_0,esp_tx[1]._2_pin_1,esp_tx[1]._2_pin_2,esp_tx[1]._2_pin_3,esp_tx[1]._2_pin_4,esp_tx[1]._2_pin_5);
        ESP_LOGE("bsp_showWorld.h","%d %d %d %d %d %d   %d %d %d %d %d %d",
            esp_tx[2].CELL_0,esp_tx[2].CELL_1,esp_tx[2].CELL_2,esp_tx[2].CELL_3,esp_tx[2].CELL_4,esp_tx[2].CELL_5,
            esp_tx[2]._2_pin_0,esp_tx[2]._2_pin_1,esp_tx[2]._2_pin_2,esp_tx[2]._2_pin_3,esp_tx[2]._2_pin_4,esp_tx[2]._2_pin_5);
        break;
        case 1:
        uart_write_bytes(UART_NUM_2,&esp_tx[3],sizeof(esp_tx_t));
        vTaskDelay(100);
        ESP_ERROR_CHECK(uart_wait_tx_done(UART_NUM_2, 100));
        uart_write_bytes(UART_NUM_2,&esp_tx[4],sizeof(esp_tx_t));
        vTaskDelay(100);
        ESP_ERROR_CHECK(uart_wait_tx_done(UART_NUM_2, 100));
        uart_write_bytes(UART_NUM_2,&esp_tx[5],sizeof(esp_tx_t));
        vTaskDelay(100);
        ESP_ERROR_CHECK(uart_wait_tx_done(UART_NUM_2, 100));
        ESP_LOGW("bsp_showWorld.h", "show wold [%s] ing in uart",prudent[show_index]);
        ESP_LOGW("bsp_showWorld.h", "wold page is in 1 ing--------------");
        ESP_LOGW("bsp_showWorld.h", "BrailleCode[show_index][6] is %d", BrailleCode_tt[show_index][6]);
        ESP_LOGW("bsp_showWorld.h", "BrailleCode[show_index][7] is %d", BrailleCode_tt[show_index][7]);
        ESP_LOGW("bsp_showWorld.h", "BrailleCode[show_index][8] is %d", BrailleCode_tt[show_index][8]);
        ESP_LOGW("bsp_showWorld.h", "BrailleCode[show_index][9] is %d", BrailleCode_tt[show_index][9]);
        ESP_LOGW("bsp_showWorld.h", "BrailleCode[show_index][10] is %d", BrailleCode_tt[show_index][10]);
        ESP_LOGW("bsp_showWorld.h", "BrailleCode[show_index][11] is %d", BrailleCode_tt[show_index][11]);
        ESP_LOGE("bsp_showWorld.h", "%d %d %d %d %d %d   %d %d %d %d %d %d",
            esp_tx[3].CELL_0, esp_tx[3].CELL_1, esp_tx[3].CELL_2, esp_tx[3].CELL_3, esp_tx[3].CELL_4, esp_tx[3].CELL_5,
            esp_tx[3]._2_pin_0, esp_tx[3]._2_pin_1, esp_tx[3]._2_pin_2, esp_tx[3]._2_pin_3, esp_tx[3]._2_pin_4, esp_tx[3]._2_pin_5);
        ESP_LOGE("bsp_showWorld.h", "%d %d %d %d %d %d   %d %d %d %d %d %d",
            esp_tx[4].CELL_0, esp_tx[4].CELL_1, esp_tx[4].CELL_2, esp_tx[4].CELL_3, esp_tx[4].CELL_4, esp_tx[4].CELL_5,
            esp_tx[4]._2_pin_0, esp_tx[4]._2_pin_1, esp_tx[4]._2_pin_2, esp_tx[4]._2_pin_3, esp_tx[4]._2_pin_4, esp_tx[4]._2_pin_5);
        ESP_LOGE("bsp_showWorld.h", "%d %d %d %d %d %d   %d %d %d %d %d %d",
            esp_tx[5].CELL_0, esp_tx[5].CELL_1, esp_tx[5].CELL_2, esp_tx[5].CELL_3, esp_tx[5].CELL_4, esp_tx[5].CELL_5,
            esp_tx[5]._2_pin_0, esp_tx[5]._2_pin_1, esp_tx[5]._2_pin_2, esp_tx[5]._2_pin_3, esp_tx[5]._2_pin_4, esp_tx[5]._2_pin_5);
        break;
        case 2:
        uart_write_bytes(UART_NUM_2,&esp_tx[6],sizeof(esp_tx_t));
        vTaskDelay(100);
        ESP_ERROR_CHECK(uart_wait_tx_done(UART_NUM_2, 100));
        uart_write_bytes(UART_NUM_2,&esp_tx[7],sizeof(esp_tx_t));
        vTaskDelay(100);
        ESP_ERROR_CHECK(uart_wait_tx_done(UART_NUM_2, 100));
        uart_write_bytes(UART_NUM_2,&esp_tx[8],sizeof(esp_tx_t));
        vTaskDelay(100);
        ESP_ERROR_CHECK(uart_wait_tx_done(UART_NUM_2, 100));
        ESP_LOGW("bsp_showWorld.h", "show wold [%s] ing in uart",prudent[show_index]);
        ESP_LOGW("bsp_showWorld.h", "wold page is in 2 ing--------------");
        ESP_LOGW("bsp_showWorld.h", "BrailleCode[show_index][6] is %d", BrailleCode_tt[show_index][12]);
        ESP_LOGW("bsp_showWorld.h", "BrailleCode[show_index][7] is %d", BrailleCode_tt[show_index][13]);
        ESP_LOGW("bsp_showWorld.h", "BrailleCode[show_index][8] is %d", BrailleCode_tt[show_index][14]);
        ESP_LOGW("bsp_showWorld.h", "BrailleCode[show_index][9] is %d", BrailleCode_tt[show_index][15]);
        ESP_LOGW("bsp_showWorld.h", "BrailleCode[show_index][10] is %d", BrailleCode_tt[show_index][16]);
        ESP_LOGW("bsp_showWorld.h", "BrailleCode[show_index][11] is %d", BrailleCode_tt[show_index][17]);
        ESP_LOGE("bsp_showWorld.h", "%d %d %d %d %d %d   %d %d %d %d %d %d",
            esp_tx[6].CELL_0, esp_tx[6].CELL_1, esp_tx[6].CELL_2, esp_tx[6].CELL_3, esp_tx[6].CELL_4, esp_tx[6].CELL_5,
            esp_tx[6]._2_pin_0, esp_tx[6]._2_pin_1, esp_tx[6]._2_pin_2, esp_tx[6]._2_pin_3, esp_tx[6]._2_pin_4, esp_tx[6]._2_pin_5);
        ESP_LOGE("bsp_showWorld.h", "%d %d %d %d %d %d   %d %d %d %d %d %d",
            esp_tx[7].CELL_0, esp_tx[7].CELL_1, esp_tx[7].CELL_2, esp_tx[7].CELL_3, esp_tx[7].CELL_4, esp_tx[7].CELL_5,
            esp_tx[7]._2_pin_0, esp_tx[7]._2_pin_1, esp_tx[7]._2_pin_2, esp_tx[7]._2_pin_3, esp_tx[7]._2_pin_4, esp_tx[7]._2_pin_5);
        ESP_LOGE("bsp_showWorld.h", "%d %d %d %d %d %d   %d %d %d %d %d %d",
            esp_tx[8].CELL_0, esp_tx[8].CELL_1, esp_tx[8].CELL_2, esp_tx[8].CELL_3, esp_tx[8].CELL_4, esp_tx[8].CELL_5,
            esp_tx[8]._2_pin_0, esp_tx[8]._2_pin_1, esp_tx[8]._2_pin_2, esp_tx[8]._2_pin_3, esp_tx[8]._2_pin_4, esp_tx[8]._2_pin_5);
        break;
    }
}

void show_wold_init(){
    
    xTaskCreatePinnedToCore(show_task, "show Task", 2048*5, NULL, 12, NULL,1);
    //xTaskCreatePinnedToCore(user_mp3_player_task, "_jq_task Task", 2048*5, NULL, 12, show_sd_handle,1);
    //vTaskSuspend(show_sd_handle);

   
}
